module.exports = async (ctx, next) => {
  ctx.set("Access-Control-Allow-Origin", '*')
  ctx.set("Access-Control-Allow-Headers", "Content-Type,Content-Length, Authorization, Accept, X-Requested-With, Content-Key")
  ctx.set("Access-Control-Allow-Methods", "OPTIONS, PUT, POST, GET, DELETE")
  ctx.set("X-Powered-By", '3.2.1')
  ctx.set('Access-Control-Allow-Credentials', true);
  if (ctx.request.method == "OPTIONS") {
    ctx.body = {
      status: true
    };
    return
  }
  await next()
}